package com.kate.cloud.shiro.dao;

import com.kate.cloud.shiro.entity.JzRole;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface JzRoleMapper {
    int deleteByPrimaryKey(String id);

    int insert(JzRole record);

    int insertSelective(JzRole record);

    JzRole selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(JzRole record);

    int updateByPrimaryKey(JzRole record);

    @Select("SELECT jz_role.id,jz_role.name FROM jz_role " +
            "INNER JOIN jz_user_role ON jz_role.id = jz_user_role.role_code " +
            "INNER JOIN jz_user ON jz_user.id = jz_user_role.user_code " +
            "WHERE jz_user.login_name = #{loginName}")
    List<JzRole> selectByLoginName(String loginName);
}